/*
 * Copyright [2008]. Sherwin zhu. sherwinzhu@126.com
 *
 * http://www.gnu.org/licenses/lgpl-3.0.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections;
using System.Reflection;
using System.Web;
using System.Web.UI.WebControls;

namespace TB.Web.UI.WebControls
{
    class TreeGridRowCollection : ICollection, IEnumerable
    {
        public TreeGridRowCollection(ArrayList rows)
        {
            this._rows = rows;
        }

        public void CopyTo(TreeGridRow[] array, int index)
        {
            this.CopyTo(array, index);
        }

        public IEnumerator GetEnumerator()
        {
            return this._rows.GetEnumerator();
        }

        void ICollection.CopyTo(Array array, int index)
        {
            IEnumerator enumerator1 = this.GetEnumerator();
            while (enumerator1.MoveNext())
            {
                array.SetValue(enumerator1.Current, index++);
            }
        }

        public int Count
        {
            get
            {
                return this._rows.Count;
            }
        }

        public bool IsReadOnly
        {
            get
            {
                return false;
            }
        }

        public bool IsSynchronized
        {
            get
            {
                return false;
            }
        }

        public TreeGridRow this[int index]
        {
            get
            {
                return (TreeGridRow)this._rows[index];
            }
        }

        public object SyncRoot
        {
            get
            {
                return this;
            }
        }

        private ArrayList _rows;
    }
}
